#ifndef MSMD_H
#define MSMD_H
#ifdef __cplusplus
   extern "C"{
#endif
#include <libmslog/mstype.h>
#include "mssignal.h"
typedef enum{
	memclear_none		=0x00,
	memclear_pagecache,
	memclear_dentries_inodes,
	memclear_all,
}MEMCLEARLevel;


typedef enum {
	decencmode_sw		=0x00,
	decencmode_nvidia	,
	decencmode_intel		
}DECENCMode;

typedef struct {
	int opt;
	ms_string optName;
	void (*optFunc) (void *optFuncArg,ms_string optVal);
	void *optFuncArg;
	ms_string defaultVal;

}MDOPTList;

#define msstring_decencmode	"sw","nvidia","intel"

#define mscfg_maxnum_cpu 			256
#define mscfg_maxphysicsnum_cpu 	4
#define mscfg_maxnum_partiton		64
#define msnet_maxnum_iface			64
#define msnet_maxnum_diskdev		8
#define maxlen_dmidecode_info		2048
#define maxlen_blkserial_info		512
#define maxlen_systemuuid			128
#define maxlen_processorid			1024

#ifndef MSMD_C
extern ms_bool 
	msmd_api_fileFormatFilter(ms_string ms_in filename);
extern ms_u32 
	msmd_api_randomU32(ms_u32 min,ms_u32 max );
extern ms_void 
	msmd_api_randomInsert(ms_byte *bufData,ms_s32 len_data,ms_s32 data_offset);
extern ms_void 
	msmd_api_randomStr(ms_byte* poutBuf, ms_u32 len);
extern ms_void 
	msmd_api_randomString(ms_byte* outStr);
extern ms_s32 
	msmd_api_read(ms_string ms_in filename,ms_pu08 ms_in buf,ms_u32 ms_in size);
extern ms_s32 
	msmd_api_write(ms_string ms_in filename,ms_pu08 ms_in buf,ms_u32 ms_in size,ms_string stropt);
extern ms_s32 
	msmd_api_read2(ms_string ms_in filename,ms_pu08 ms_in buf,ms_u32 ms_in size);
extern ms_s32 
	msmd_api_read3(ms_string ms_in filename,ms_pu08 ms_in buf,ms_u32 ms_in size);
extern ms_s64 
	msmd_api_getFileSize(ms_string ms_in filename);
extern ms_bool 
	msmd_api_newMsgFile(ms_string ms_in filename);
extern ms_s32 
	msmd_api_writeProtect(ms_string ms_in filename,ms_pu08 ms_in buf,ms_u32 ms_in size);
extern ms_s32 
	msmd_api_writea(ms_string ms_in filename,ms_pu08 ms_in buf,ms_u32 ms_in size);
extern ms_s32 
	msmd_api_getCpuNum(ms_void);
extern ms_s08 
	msmd_api_changeUser(ms_string ms_in username);
extern ms_void 
	msmd_api_clearCache( MEMCLEARLevel ms_in);
extern ms_void 
	msmd_api_clearSysLog( ms_void);
extern ms_void 
	msmd_api_clearAppLog( ms_void);
extern ms_void 
	msmd_api_cleanKernelUpgradeFile( ms_void);
extern ms_bool 
	msmd_api_isFileExsit(ms_string ms_in filename);
extern ms_bool 
	msmd_api_isInstall(ms_string name);
ms_bool 
	msmd_api_isInstallByBin(ms_string binname);
extern DECENCMode  
	msmd_api_getDecEncMode(ms_void)  ;
extern ms_s08 
	msmd_api_setUlimit(ms_void);
extern ms_void 
	msmd_api_setCpuFreq(ms_void);
extern ms_void 
	msmd_api_taskSched(unsigned long pid,int cup_start,int cup_end) ; 
extern ms_void 
	msmd_api_pstree(ms_string pos_version,ms_u32 pid,ms_string strout);
extern ms_bool 
	msmd_api_checkVarTypeLen(ms_string obuf,ms_string exInfo);
extern ms_bool 
	msmd_api_timeToSave(ms_u64 *prequest_intime);
extern ms_void 
	msmd_api_watchdog(ms_s32 (*childfunc)(ms_pvoid ),ms_pvoid ms_in arg);
extern ms_void 
	msmd_api_startDaemon(ms_string ms_in logdir);
extern ms_void 
	msmd_api_parseOpt(int argc, char **argv,ms_string optstring,MDOPTList *pmdoptList,ms_s32 optListNum);
extern ms_s32 
	msmd_api_ascii2Base64(const ms_byte * ms_in base64Char,const ms_u08* ms_in pchar, ms_s32 ms_in len_char, ms_byte* ms_out pbase64);
extern ms_s32 
	msmd_api_base642Ascii(const ms_byte * ms_in base64Char,const char* ms_in pbase64, ms_u08* ms_out pchar);
extern ms_string 
	msmd_api_getFileType(ms_string filename);
extern ms_bool 
	msmd_api_isConflictLib(ms_string libname,ms_string main_ver,ms_string version);
#endif
#ifdef __cplusplus
}
#endif
#endif

